/*******************************************OVERVIEW*******************************************************
 
Suffrage Reform and Financial Volatility
 
Replication file
 
Table 3: Political Uncertainty and Consol Prices
 
Version March 14 2022 
 
  
********************************************************************************************************************/

clear
set more off
#delimit ;


/*Set Directory -- You will need to adjust this line of code accordingly */; 


cd "/Users/ssaiegh/Files/Mac/JHPE";

/*Create Log File*/;

log using "Table 3", replace text;


/*Load Data File*/;


use "garch_analysis.dta";


/*Declare Time Series */;

tsset case;

/*Calculate Cumulative Riots/Contentious Gatherings (30 Days) */;

tssmooth ma ma_swing=n_swing, window(29 1 0);

gen cum_swing=ma_swing*30;

tssmooth ma ma_reform=n_reform, window(29 1 0);

gen cum_reform=ma_reform*30;

replace cum_reform=ma_reform*(case_id) if case_id<30;

/* Calculate Percent Returns */;

gen per_ret=((adjusted-L.adjusted)/L.adjusted)*100;

/*Estimate GARCH Models */;


arch per_ret cum_swing cum_reform vote2, arch(1) garch(1) het(elec crisis war L.settlment shut) vce(robust);

arch per_ret cum_swing cum_reform vote2, arch(1) garch(1) het(cum_swing cum_reform vote2 elec crisis war L.settlment shut) vce(robust);

arch per_ret, arch(1) garch(1) het(cum_swing cum_reform vote2 elec crisis war  L.settlment shut) vce(robust) archm;

arch per_ret, earch(1) egarch(1) het(cum_swing cum_reform vote2 elec crisis war  L.settlment shut) vce(robust); 


log c;
